#sing  SetLocal EnableDelayedExpansion
#newl set container=#exte|#newl set container=.mka|#newl set container=.m4a|#newl set container=.mp3|#newl set container=.oga|#newl set container=.aac|#newl set container=.flac|#newl set container=.opus|#newl set container=.wav|#newl set container=.mp2|#newl set container=.ogg|#newl set container=.mkv|#newl set container=.mp4|--select container--
#newl set tempfile=#path#name-temp-csv.txt
#newl "#ppthapps\ffmpeg\ffprobe.exe" -i "#item" -of csv=p=0:e=c -sexagesimal -show_entries chapter_tags=title:chapter=start_time,end_time > "%tempfile%"
#newl
#newl FOR /F "usebackq tokens=1,2,* delims=," %%a in ("%tempfile%") do (
#newl set title=%%c
#newl set title=!title:\n=!
#newl set title=!title:\r=!
#newl set title=!title:\t=!
#newl set title=!title:\f=!
#newl set title=!title:\=!
#newl set title=!title::=,!
#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -vn -ss %%a -to %%b |
-c:a copy |-c:a opus -b:a 16k | -b:a 64k -vn |--select codec or bitrate--
#remark add cover image, if you have it|-attach "#path#name.jpg" -metadata:s mimetype="image/jpeg" -metadata:s filename="#name.jpg" |--attach cover image--
"#path!title!%container%" |--output--
#newl )
#newl del "%tempfile%"

<comment>
Parse m4b file, and extract audio chapters to single files.
Use m4a container form m4b files, opus for opus.
Default output container is original file extension.
You can also change bitrate, or codec and bitrate, by changing the '-c:a copy'  line in the script.
You can use filename.jpg cover if you have it.

replace " with ,
#newl set title=!title:"=,!

#newl set title=!title::=,!
replace : with ,